package top.wettis.chat.service.impl;

import cn.hutool.db.sql.Direction;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.logging.log4j.util.Strings;
import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties;
import top.wettis.chat.pojo.DO.Expert;
import top.wettis.chat.pojo.DO.JobImfor;
import top.wettis.chat.mapper.JobImforMapper;
import top.wettis.chat.pojo.VO.Result;
import top.wettis.chat.service.IJobImforService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 具体职业信息 服务实现类
 * </p>
 *
 * @author wettis
 * @since 2023-04-13
 */
@Service
public class JobImforServiceImpl extends ServiceImpl<JobImforMapper, JobImfor> implements IJobImforService {

    @Override
    public Result<Object> selectAll() {
        List<JobImfor> jobImfors = getBaseMapper().selectList(null);

        return Result.customInfo(200, "显示成功", jobImfors);
    }

    public List<JobImfor> expertPage(String jobName) {
        LambdaQueryWrapper<JobImfor> jobImforLambdaQueryWrapper = new LambdaQueryWrapper<>();
        jobImforLambdaQueryWrapper.like(Strings.isNotEmpty(jobName), JobImfor::getJobName, jobName);
        return this.list(jobImforLambdaQueryWrapper);
    }
}
